package com.feihong.txgw.inter.contract.product;

import com.feihong.txgw.json.goodsCart.GoodsCartParser;
import com.feihong.txgw.json.goodsCart.TerminalListParser;
import com.feihong.txgw.model.greendao.ShopCarGoodsModel;
import com.feihong.txgw.shopcar.bean.TerminalEntiyt;
import com.feihong.txgw.ui.mvp.model.IBaseModel;
import com.feihong.txgw.ui.mvp.precenter.AbBasePrecenter;
import com.feihong.txgw.ui.mvp.view.IBaseActivity;

import java.util.List;

import io.reactivex.Observable;

/**
 * @Author wangziheng
 * @ProjectName txgw_app
 * @ClassName IProListContract
 * @package com.feihong.txgw.inter.contract.product
 * @data 2018/5/8 12:17
 * @Describe
 * @Change
 */
public interface IProListContract {

    interface IProListMainView extends IBaseActivity{

        /**
         * 展示终端商品信息
         * @param goodsEntities
         * @param isLoadEnd  数据加载完毕
         */
        void getTerminalGoodsResult(TerminalListParser goodsEntities,boolean isLoadEnd);

        /**
         * 添加到购物车出现错误
         */
        void addGoodsToShopCarError();

        void loadEnd();
    }

    interface IProListMainModel extends IBaseModel{
        /**
         * 获取终端商品列表
         * @param pageSize
         * @param storeID
         * @param pageNum
         * @return
         */
        Observable<TerminalListParser> getTerminalGoods(String pageSize, String storeID, String pageNum);

        /**
         * 添加商品到购物车
         * @param goods
         * @return
         */
        Observable<GoodsCartParser> realAddGoodsToShopCar(List<ShopCarGoodsModel> goods);
        Observable addGoodsToShopCar(TerminalEntiyt terminalEntiyt);
    }

    abstract class AbProListMainPrecenter extends AbBasePrecenter<IProListMainModel,IProListMainView>{

        public abstract void getTerminalGoods(String storeID);

        public abstract void getTerminalFirstGoods(String storeID);


        /**
         * 添加商品到购物车
         * @param terminalEntiyt
         */
        public abstract void addGoodsToShopCar(TerminalEntiyt terminalEntiyt);

    }

}
